﻿#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    partial class Strategy
    {
        ///Returns the day of week (0 for Sun., 1 for Mon., ..., 6 for Sat.) for a calendar date.
        ///Syntax: DayOfWeek(cDate);
        ///cDate: numeric expression for the date in YYMMDD or YYYMMDD format
        public int DayOfWeek(int cDate)
        {
            DateTime d = new DateTime(NormalizeYear(Year(cDate)), Month(cDate), DayOfMonth(cDate));
            return (int)d.DayOfWeek;
        }

    }
}
